package com.example.nio.netty.codec;

import com.example.nio.netty.protoco.PackageCodec;
import com.example.nio.netty.protoco.Packet;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class PacketEncoder extends MessageToByteEncoder<Packet> {

    @Override
    protected void encode(ChannelHandlerContext ctx, Packet msg, ByteBuf out) throws Exception {
        PackageCodec.INSTANCE.encode(msg, out);
    }
}
